import Vue from 'vue'
import {
  Button,
  Tabbar,
  TabbarItem,
  Icon,
  Tab,
  Tabs,
  List,
  Cell,
  Toast,
  Lazyload,
  NavBar,
  DropdownMenu,
  DropdownItem,
  Skeleton,
  IndexBar,
  IndexAnchor,
  Grid,
  GridItem,
  Dialog,
  Form,
  Field
} from 'vant'

Lazyload.name = 'Lazyload'
;[
  Button,
  Tabbar,
  TabbarItem,
  Icon,
  Tab,
  Tabs,
  List,
  Cell,
  Toast,
  Lazyload,
  NavBar,
  DropdownMenu,
  DropdownItem,
  Skeleton,
  IndexBar,
  IndexAnchor,
  Grid,
  GridItem,
  Dialog,
  Form,
  Field
].forEach(cmp => {
  if (cmp.name === 'Lazyload') {
    Vue.use(Lazyload, {
      loading: 'http://www.mobiletrain.org/images/index/new_logo.png'
    })
  } else {
    Vue.use(cmp)
  }
})
